package ui.table_view
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	public class TableViewDataSource implements I_TableViewDataSource
	{
		public function TableViewDataSource()
		{
		}
		
		public function getCellCount(tabView:TableView):int
		{
			return 50;
		}
		
		public function getCellSize(tabView:TableView):int
		{
			return 30;
		}
		
		public function cellByIndex(tabView:TableView,tabIndex:int):DisplayObject
		{
			var cell:Sprite = new Sprite;
			cell.graphics.beginFill(Math.floor(Math.random() * 0xFFFFFF),1);
			cell.graphics.drawRect(0,0,320,30);
			cell.graphics.endFill();
			
			var tf:TextField = new TextField;
			tf.autoSize = TextFieldAutoSize.CENTER;
			tf.text = tabIndex.toString(); 
			cell.addChild(tf);
			
			return cell;
		}
	}
}